$(function() {
    var dom = document.getElementById("moldFaultClassifyTimesDiv");
    var moldFaultClassifyTimesChart = echarts.init(dom);
    var app = {};
    // option
    option = {
        toolbox: {
            show: true,
            trigger: 'axis',
            axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            },
            formatter: function (params) {
                var tar = params[1];
                return tar.name + '<br/>' + tar.seriesName + ' : ' + tar.value;
            }
        },
        color: ['#00f6ff'],
        tooltip: {
            trigger: 'axis'
        },
        grid: {
            bottom: '30%',
            top:'5%'
        },
        xAxis: [{
            type: 'category',
            data: ["模具维修", "更换芯型、馕件", "水管故障", "模具跑水", "燃烧室上浮", "更换密封条", "真空阀故障", "模具漏气", "卡缸套", "打磨放电"],
            axisLine: {
                lineStyle: {
                    color: '#ccc'
                }
            },
            axisLabel: {interval:0,rotate: 40 }
        }],
        yAxis: [
            {
                type: 'value',
                minInterval: 1,
                axisLine: {
                    lineStyle: {
                        color: '#ccc'
                    }
                }
            }
        ],
        series: [
            {
                name: "故障次数",
                type: 'bar',
                data: [18, 10, 2, 1, 1, 1, 1, 1, 0, 0]
            }
        ]
    }
    if (option && typeof option === "object") {
        moldFaultClassifyTimesChart.setOption(option, true);
    }
})